package com.one.controller;


import com.one.bo.EvaluationBo;
import com.one.bo.SelectUserBo;
import com.one.dto.Result;
import com.one.service.StudentSemesterTeacherService;
import com.one.service.SysUserService;
import com.one.utils.TokenUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * VIEW 前端控制器
 * </p>
 *
 * @author zwj
 * @since 2021-10-11
 */
@RestController
@RequestMapping("/evaluation")
public class StudentSemesterTeacherController {
    private final StudentSemesterTeacherService studentSemesterTeacherService;

    public StudentSemesterTeacherController(StudentSemesterTeacherService studentSemesterTeacherService) {
        this.studentSemesterTeacherService = studentSemesterTeacherService;
    }
    @ApiOperation(value = "查询待评教教师", notes = "查询待评教教师")
    @PostMapping("/selectEvaluation")
    public Result selectEvaluation(@RequestBody EvaluationBo evaluationBo, HttpServletRequest request) {
        String userID = TokenUtils.getUserID(request);
        return studentSemesterTeacherService.selectEvaluation(evaluationBo,userID);
    }
    @ApiOperation(value = "评教", notes = "评教")
    @PostMapping("/teachaerEvaluation")
    public Result teachaerEvaluation(@RequestBody EvaluationBo evaluationBo, HttpServletRequest request) {
        String userID = TokenUtils.getUserID(request);
        return studentSemesterTeacherService.teachaerEvaluation(evaluationBo,userID);
    }
    @ApiOperation(value = "评教记录", notes = "评教记录")
    @PostMapping("/getEvaluationLog")
    public Result getEvaluationLog(@RequestBody EvaluationBo evaluationBo) {
        return studentSemesterTeacherService.getEvaluationLog(evaluationBo);
    }
}

